package com.mszlu.blog.controller;


import com.mszlu.blog.service.TagService;
import com.mszlu.blog.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("tags")
public class TagController {

    @Autowired
    private TagService tagService;

    @RequestMapping(value = "hot",method = RequestMethod.GET)
    public Result hot(){
        int limit =6;
       return tagService.hots(limit);
    }

    @GetMapping
    public Result tags(){

        return tagService.findAll();
    }


    @GetMapping("detail")
    public Result tagsDetail(){

        return tagService.findAllDetail();
    }


    @GetMapping("detail/{id}")
    public Result tagsDetail(@PathVariable("id") Long id){

        return tagService.findAllDetailById(id);
    }
}
